package cn.cai.controller;

import cn.cai.commonUtils.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

/**
 * 管理后台用户的登录
 */
@RestController
@RequestMapping("/eduservice/admin")
@CrossOrigin
@Api(value = "用户登录接口",tags = "用户登录接口")
public class ServiceUser {
    /**
     * 后台用户登录
     * @return json对象
     */
    @PostMapping("/user/login")
    @ApiOperation("用户登录")
    public Result login(){
        return Result.success().data("token","admin");
    }

    @GetMapping("/user/info")
    @ApiOperation("返回用户基本信息")
    public Result info(){
        return Result.success()
                .data("roles","[蔡申傲]")
                .data("introduction","我是一名管理员")
                .data("avatar","https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif")
                .data("name","蔡申傲");
    }
}
